package 面试经典150题.字符串;

/**
 * @author tmh
 * @date 2024/4/9 21:17
 * @description
 */
public class T58最后一个单词的长度 {
    public int lengthOfLastWord(String s) {
        String[] wordArray = s.split(" ");
        String word = wordArray[wordArray.length - 1];
        return word.length();
    }
}
